package com.books.mapper;

import com.books.entity.EbookEntry;
import com.books.entity.EbookEntryExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EbookEntryMapper {
    long countByExample(EbookEntryExample example);

    int deleteByExample(EbookEntryExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(EbookEntry record);

    int insertSelective(EbookEntry record);

    List<EbookEntry> selectByExample(EbookEntryExample example);

    EbookEntry selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") EbookEntry record, @Param("example") EbookEntryExample example);

    int updateByExample(@Param("record") EbookEntry record, @Param("example") EbookEntryExample example);

    int updateByPrimaryKeySelective(EbookEntry record);

    int updateByPrimaryKey(EbookEntry record);

    /**
     * 根据电子图书的id查询分类和条目
     *
     * @param id
     * @return
     */
    EbookEntry findById(Integer id);

    /**
     * 分页查询
     *
     * @param categoryId
     * @return
     */
    List<EbookEntry> findByEntryId(Integer categoryId);
}